from flask import make_response, jsonify
from application02.utils import LogUtil as lp_logging


def my_response(code, message, info=None, status_code=200):
    response = make_response(
        jsonify({'code': code, 'msg': message, 'info': info, 'trace_id': lp_logging.TraceID.get_trace()}))
    response.status_code = status_code
    response.headers['Access-Control-Allow-Origin'] = '*'
    return response
